/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo1008;

import java.util.ArrayList;
import java.util.Collections;

/**
 *
 * @author Administrator
 */
public class ArrayListStringDemo {

    public static void main(String args[]) {
        ArrayList<String> stringList = new ArrayList<String>();
        stringList.add("zhang");
        stringList.add("li");
        stringList.add("wang");
        Collections.sort(stringList);
        for (int i = 0; i < stringList.size(); i++) {
            System.out.println(stringList.get(i));

        }

        for (String s : stringList) {
            System.out.println(s);
        }
    }
}
